<template>
	<view class="menu">
		<view class="menu_content x-f">
			<view class="item tc" v-for="(item,index) in menu" :key="index" @tap.stop="jump(item)">
				<image :src="item.img" :style="{width:ico_width,height:ico_height}"></image>
				<view>{{ item.label }}</view>
			</view>
		</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				goodUrl: '/pages/seller/choiceness/index',
				}
		},
		props: {
			menu: {
				type: Array,
				default: () => []
			},
			width: {
				type: Number,
				default: 70
			},
			height: {
				type: Number,
				default: 70
			},
		},
		computed: {
			ico_width() {
				return uni.upx2px(this.width) + 'px'
			},
			ico_height() {
				return uni.upx2px(this.height) + 'px'
			}
		},
		methods: {
			// 路由
			jump(item) {
				if(item.url !== '') {
					this.$Router.push({
						path: item.url
					});
				} else {
					this.$tools.toast('暂无开发该功能')
				}
				this.$emit('chang', item)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.menu {
	    padding-top: 40rpx;
		background: #FFFFFF;
	    color: #333;
		border-radius: 16rpx;
	    .menu_content {
	        width: 100%;
	        background: #fff;
	        display: flex;
	        flex-wrap: wrap;
	        border-radius: 16rpx;			
	        .item {
	            width: 25%;
	            padding-bottom: 48rpx;
	            display: flex;
	            flex-direction: column;
	            align-items: center;
	            font-size: 26rpx;
	            image {
	                padding-bottom: 16rpx;
	            }
	        }
	    }
	}
</style>
